package jschtest;

import io.SshBean;

public class UploadRunnable implements Runnable{

    private SshBean sshBean;
    private String src;
    private String dest;

    public UploadRunnable(SshBean sshBean, String srcFile, String destFile){
        this.sshBean = sshBean;
        this.src = srcFile;
        this.dest = destFile;
    }

    @Override
    public void run() {

//        System.out.println(sshBean.getIp() + " delete file result1 is :" + JschTool.execCommand(sshBean,"rm -rf /home/jsch/"));
//        System.out.println(sshBean.getIp() + " mkdir result is :" + JschTool.execCommand(sshBean,"mkdir /home/jsch/"));
        long start = System.currentTimeMillis();
        System.out.println(sshBean.getIp() + " uploadFile result is :" + JschTool.uploadFile(sshBean, src, dest));
        System.out.println(sshBean.getIp() + " uploadFile cost time is " + (System.currentTimeMillis() - start));
    }
}
